﻿using System;
using System.ComponentModel;

namespace HalconDotNet
{
	// Token: 0x0200007B RID: 123
	public class HOperatorException : HalconException
	{
		// Token: 0x06001D98 RID: 7576 RVA: 0x000B49C2 File Offset: 0x000B2BC2
		public HOperatorException(int err, string sInfo, Exception inner) : base(err, (sInfo == "") ? HalconAPI.GetErrorMessage(err) : sInfo, inner)
		{
		}

		// Token: 0x06001D99 RID: 7577 RVA: 0x000B49E2 File Offset: 0x000B2BE2
		public HOperatorException(int err, string sInfo) : this(err, sInfo, null)
		{
		}

		// Token: 0x06001D9A RID: 7578 RVA: 0x000B49ED File Offset: 0x000B2BED
		public HOperatorException(int err) : this(err, "")
		{
		}

		// Token: 0x06001D9B RID: 7579 RVA: 0x000B49FB File Offset: 0x000B2BFB
		[Obsolete("GetErrorText is deprecated, please use GetErrorMessage instead.")]
		[EditorBrowsable(EditorBrowsableState.Never)]
		public new string GetErrorText()
		{
			return HalconAPI.GetErrorMessage(base.GetErrorCode());
		}

		// Token: 0x06001D9C RID: 7580 RVA: 0x000B49FB File Offset: 0x000B2BFB
		public new string GetErrorMessage()
		{
			return HalconAPI.GetErrorMessage(base.GetErrorCode());
		}

		// Token: 0x06001D9D RID: 7581 RVA: 0x000B4A08 File Offset: 0x000B2C08
		public long GetExtendedErrorCode()
		{
			HTuple htuple;
			HTuple htuple2;
			HTuple htuple3;
			HOperatorSet.GetExtendedErrorInfo(out htuple, out htuple2, out htuple3);
			if (htuple2.Length > 0)
			{
				return htuple2[0].L;
			}
			return 0L;
		}

		// Token: 0x06001D9E RID: 7582 RVA: 0x000B4A38 File Offset: 0x000B2C38
		public string GetExtendedErrorMessage()
		{
			HTuple htuple;
			HTuple htuple2;
			HTuple htuple3;
			HOperatorSet.GetExtendedErrorInfo(out htuple, out htuple2, out htuple3);
			if (htuple3.Length > 0)
			{
				return htuple3[0];
			}
			return "";
		}

		// Token: 0x06001D9F RID: 7583 RVA: 0x000B4A6B File Offset: 0x000B2C6B
		public static void throwOperator(int err, string logicalName)
		{
			if (HalconAPI.IsFailure(err))
			{
				throw new HOperatorException(err, HalconAPI.GetErrorMessage(err) + " in operator " + logicalName);
			}
		}

		// Token: 0x06001DA0 RID: 7584 RVA: 0x000B4A90 File Offset: 0x000B2C90
		internal static void throwOperator(int err, int procIndex)
		{
			if (HalconAPI.IsFailure(err))
			{
				string logicalName = HalconAPI.GetLogicalName(procIndex);
				throw new HOperatorException(err, HalconAPI.GetErrorMessage(err) + " in operator " + logicalName);
			}
		}

		// Token: 0x06001DA1 RID: 7585 RVA: 0x000B4AC4 File Offset: 0x000B2CC4
		public static void throwInfo(int err, string sInfo)
		{
			throw new HOperatorException(err, sInfo + ":\n" + HalconAPI.GetErrorMessage(err) + "\n");
		}
	}
}
